package javolution.xml.stream;

/* loaded from: classes2.dex */
public class XMLStreamException extends Exception {
    private static final long serialVersionUID = 1;
    private Location _location;
    private Throwable _nested;

    public XMLStreamException() {
    }

    public XMLStreamException(String str) {
        super(str);
    }

    public XMLStreamException(String str, Throwable th) {
        super(str);
        this._nested = th;
    }

    public XMLStreamException(String str, Location location) {
        super(str);
        this._location = location;
    }

    public XMLStreamException(String str, Location location, Throwable th) {
        super(str);
        this._nested = th;
        this._location = location;
    }

    public XMLStreamException(Throwable th) {
        this._nested = th;
    }

    public Location getLocation() {
        return this._location;
    }

    public Throwable getNestedException() {
        return this._nested;
    }

    @Override // java.lang.Throwable
    public String toString() {
        String exc = super.toString();
        if (this._location != null) {
            exc = exc + " (at line " + this._location.getLineNumber() + ", column " + this._location.getColumnNumber() + ")";
        }
        if (this._nested != null) {
            return exc + " caused by " + this._nested.toString();
        }
        return exc;
    }
}
